#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> //sleep()
#include "sqlite3.h"
#include "m1.h"
#include "m2.h"


void print_build_time()
{
    int year = 0, month = 0, day = 0;
    int hour = 0, minute = 0, seconds = 0;
    char m[4] = {0};

    char *abbreviation_month[] = {"Jan","Feb","Mar","Apr"   \
                                    ,"May","Jun","July","Aug"   \
                                    ,"Sept","Oct","Nov","Dec"};
    sscanf(__DATE__, "%3s %2d %4d", m, &day, &year);

    // 将月份缩写转换为数字
    for (month = 0; month < 12; month++)
    {
        if (strcmp(m, abbreviation_month[month]) == 0)
        {
            month++;
            break;
        }
    }

    sscanf(__TIME__, "%2d:%2d:%2d", &hour, &minute, &seconds);

    char compile_time[32];
    snprintf(compile_time,sizeof(compile_time)-1,"%04u-%02u-%02u %02u:%02u:%02u",
                year, month, day,
                hour, minute,seconds);

    printf("build time:%s \n",compile_time);

}

int main(int argc, char* argv[])
{
    print_build_time();
    printf("sqlite3 version:%s \n",sqlite3_version);
    show_m1();
    show_m2();
   return 0;
}

